package com.edu.controller;

import com.edu.entity.CommonResult;
import com.edu.entity.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.xml.transform.Result;

@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("/getUserById/{userId}")
    public CommonResult<User> getUserById(@PathVariable("userId") Integer userId) {
        return new CommonResult(200, "success(11000)", new User(userId, "张三", "123"));
    }

    @GetMapping("/getUserByName/{userName}")
    public CommonResult<User> getUserById(@PathVariable("userName") String userName) {
        return new CommonResult(200, "success(11000)", new User(1, userName, "123"));
    }
}
